<template>
  <div id="main"></div>
</template>
<script>
export default {
  props:['option'],
  data() {
    return {
      props:['option'],
    };
  },
  mounted() {
    var chartDom = document.getElementById("main");
    var myChart = this.$echarts.init(chartDom);
    var option;

    option = {
      xAxis: {
        type: 'category',
        data: this.option.xAxis,
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
          data: this.option.series,
          type: 'bar',
          showBackground: true,
          backgroundStyle: {
            color: 'rgba(180, 180, 180, 0.2)'
          }
        }
      ]
    };
    option && myChart.setOption(option);
  },
};
</script>
<style lang="scss" scoped>
</style>
